#ifndef DINPUT
#define DINPUT

#define INITGUID

#include "OBJBASE.H"
#include<dinput.h>
#include "Map.h"
#include "Xuan.h"
#include "Monster.h"


class DInput
{
private:
	LPDIRECTINPUT8 lpdi;  //main directinput interface
	LPDIRECTINPUTDEVICE8 lpdikey;//ptr to keyboard device
	UCHAR keystate[256];
	POINT MainWorld;
public:
	DInput();
	~DInput(){};
	void init(HWND hWndMain,HINSTANCE hInstMain);
	void destroy();
	void GetKeyboardData();
	void CheckEsc(HWND hWndMain);
	UCHAR * GetKeystate();
	void SetMainPoint(POINT now);
	POINT GetMainPoint();
	void UpInfoPosition(int * worldPosition,Map * map,Xuan * xuan,Monster* mon,Bullet* bullet);

};

extern HINSTANCE hInstMain;  //main application handle
extern HWND hWndMain;          //handle to our main window

#endif DINPUT